/*******************************************************************************
 * Copyright (c) 2006 CEA LIST.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     CEA LIST - initial API and implementation
 *******************************************************************************/
package com.cea.papyrus.diagram.composite.preference;

import org.eclipse.jface.preference.ColorFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.FontFieldEditor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.uml2.uml.Port;

import com.cea.papyrus.core.utils.Debug;
import com.cea.papyrus.diagram.composite.Activator;

/**
 * Preference page for {@link Port} 
 */
public class PortPreferencePage extends FieldEditorPreferencePage
	implements IWorkbenchPreferencePage {

	/** Debug channel */
	private static final int channel = 205;

	/**
	 * Creates a new PortPreferencePage
	 */
	public PortPreferencePage() {
		super(GRID);
		setPreferenceStore(Activator.getDefault().getPreferenceStore());
		setDescription("Port Preferences");
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
	 */
	@Override
	public void createFieldEditors() {
		Debug.debug(this,"createFieldEditors()", channel);
		addField(new ColorFieldEditor(CompositeDiagramPreferenceConstants.P_PORT_BACKGROUNDCOLOR, 
				"Background Color", getFieldEditorParent()));
		addField(new ColorFieldEditor(CompositeDiagramPreferenceConstants.P_PORT_BORDERCOLOR, 
				"Border Color", getFieldEditorParent()));
		addField(new ColorFieldEditor(CompositeDiagramPreferenceConstants.P_PORT_FONTCOLOR, 
				"Font Color", getFieldEditorParent()));
		addField(new FontFieldEditor(CompositeDiagramPreferenceConstants.P_PORT_FONT, 
				"Font", getFieldEditorParent()));
	}

	/* (non-Javadoc)
	 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
	 */
	public void init(IWorkbench workbench) {
		// do nothing
	}	
}